package com.fuluwa.domain.usercenter.model.competence;

import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.ManyToOne;

import com.fuluwa.domain.security.model.User;
import com.fuluwa.domain.shared.AbstractIdDomainObject;

@Entity
public class CompetenceSubDefine extends AbstractIdDomainObject {
	@ManyToOne
	private CompetenceSubType type;

	@ManyToOne
	private User user;

	@Enumerated(EnumType.ORDINAL)
	private CompetenceScore value;

	private CompetenceSubDefine() {
	}


	public CompetenceSubDefine(User user, CompetenceSubType type, CompetenceScore value) {
		super();
		this.user = user;
		this.type = type;
		this.value = value;
	}


	public float compute() {
		return value.getValue();
	}

	public CompetenceScore getValue() {
		return value;
	}

	public CompetenceSubType getType() {
		return type;
	}
}/*
 * enum CompetenceType{ GENERIC,PROFESSION,ORG_IMPACT,HAND_WORKING } class
 * CompetenceCategory{ CompetenceType type; List<CompetenceSubCategoryScore>
 * subCategory; } //TODO competence sub category define, class
 * CompetenceSubCategoryDefine { CompetenceCategory category; String name; }
 * class CompetenceSubCategoryScore{ // String name; // LevelAddtionDefine
 * levelAddtionDefine; // CompetenceCategory parent; // List<CompetenceCategory>
 * childrens; CompetenceSubCategoryDefine categoryDefine; CompetenceScore score;
 * } class Competence{ List<CompetenceCategoryScore> categorys; float value;
 * 
 * public float compute() { //(A1+a2/2 + B1...)*(1+lvl addtion) return value; }
 * } class CompetenceCategoryScore { Long id; // String name; CompetenceType
 * type; // CompetenceCategory category; CompetenceScore score;
 * 
 * }
 */